import { http } from "@/utils/fetch";

export const ORDER_FIND_ALL = "/order/findAll";
export const EXPRESS_FIND_ALL = "/express/findAll";

/**
 * 获取订单列表
 * @param currentPage 当前页数
 * @param pageSize 分页容量
 * @param filterValue 筛选 DTO
 * @returns
 */
export const getOrderList = async (currentPage: number, pageSize: number, filterValue?: Record<string, any>) => {
  return await http("POST", `${ORDER_FIND_ALL}?currentPage=${currentPage}&pageSize=${pageSize}`, filterValue);
};

/**
 * 获取出运列表
 * @param currentPage 当前页数
 * @param pageSize 分页容量
 * @param filterValue 筛选 DTO
 * @returns
 */
export const getExpressList = async (currentPage: number, pageSize: number, filterValue?: Record<string, any>) => {
  return await http("POST", `${EXPRESS_FIND_ALL}?currentPage=${currentPage}&pageSize=${pageSize}`, filterValue);
};
